﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Messhall.Framework.Domain.Repository
{
    public interface IRepositoryReadSqlBase
    {

        /// <summary>
        /// 根据给定的搜索条件寻找业务对象，返回列表按照给定的方式排序
        /// </summary>
        /// <param name="fliter">搜索条件</param>
        /// <param name="sortCriteria">排序方式</param>
        /// <param name="ascending">倒叙还是正序</param>
        /// <returns></returns>
        Task<IList<T>> QueryAsync<T>(string sql, params object[] parameters) where T : class, new();

        /// <summary>
        /// Sql方式查询-分页
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
          Task<(IList<T>, int)> PagingAsync<T>(string sqlField, string sqlFromOrWhere, int? pageIndex, int? pageSize, (string sortName, bool sort) sortCriteria, params object[] parameters) where T : class, new();

    }
}
